package com.cykj.controller;

import com.cykj.dto.ResponseDTO;
import com.cykj.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    @RequestMapping("/query")
    public String test() {

        return "order-query";
    }
    @RequestMapping("/create")
    public String test2() {
        return "order-create";
    }
    @RequestMapping("/addOrder")
    public ResponseDTO addOrder(@RequestParam int userId, @RequestParam int goodId, @RequestParam int num) {
        return orderService.addOrder(userId,goodId,num);
    }
}